<?php
add_action( 'init', 'create_post_type' );
            function create_post_type() {
        
           
       
        register_post_type( 'faq',
            array(
                'labels' => array(
                        'name' => __( 'FAQ' ),
                        'singular_name' => __( 'faq' ),
                        'add_new' => __( 'Add New' ),
                        'add_new_item' => __( 'Add New FAQ' ),
                        'edit_item' => __( 'Edit FAQ' ),
                        'new_item' => __( 'New FAQ' ),
                        'view_item' => __( 'View Events' ),
                        'not_found' => __( 'Sorry, we couldn\'t find the FAQ you are looking for.' )
                ),
            'public' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => true,
            'menu_position' => 14,
            'has_archive' => true,
            'hierarchical' => true,
            'capability_type' => 'post',
            'rewrite' => array( 'slug' => 'faq' ),
            'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' )
            )
        );
    }
    
    ?>
    
    
    <?php
                            global $post;
                            $args = array( 'posts_per_page' => -1, 'post_type'=> 'faq' );
                            $myposts = get_posts( $args );
                            foreach( $myposts as $post ) : setup_postdata($post); ?>
                           
                           
                           
                            <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="headingfour">
                              <h4 class="panel-title">
                                <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#post-<?php the_ID(); ?>" aria-expanded="false" aria-controls="post-<?php the_ID(); ?>">
                                  <?php the_title(); ?>
                                </a>
                              </h4>
                            </div>
                            <div id="post-<?php the_ID(); ?>" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingfour">
                              <div class="panel-body">
                                <?php the_content(); ?>
                              </div>
                            </div>
                          </div>
                        <?php endforeach; ?>